package com.example.demostatementapi.statement.controller;

import com.example.demostatementapi.common.result.Result;
import com.example.demostatementapi.model.dto.StatementDTO;
import com.example.demostatementapi.statement.service.StatementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据报表 前端控制层
 *
 * @author Lv
 * @date 2024/07/11
 */
@RestController
@RequestMapping("/statement")
public class StatementController {

    @Autowired
    private StatementService statementService;

    /**
     * 读取报表数据
     *
     * @param statementDTO 数据报表数据传递对象
     * @return
     */
    @PostMapping("/find_count")
    public Result<?> findCount(@RequestBody StatementDTO statementDTO) {
        return Result.success(statementService.findCount(statementDTO));
    }
}

